<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    <h:form id="frmRegister">
        <f:view>
            <p:dialog id="dlgRegister"
                      widgetVar="wgRegister"
                      header="Register"
                      draggable="true"
                      showEffect="clip"
                      hideEffect="clip"
                      modal="true"
                      closable="false">
                <h:panelGrid id="pnRegister" columns="3" cellspacing="5" >
                    <p:inputText value="#{userBean.registerCode}"/>
                    <p:commandButton
                        value="Submit"
                        actionListener="#{userBean.CheckRegisterCode}"
                        update=":growl,:frmRegisterDetail"
                        oncomplete="LoginRequest(xhr, status, args)"
                        />

                    <p:commandButton
                        value="Cancel"
                        onclick="wgRegister.hide();wgLogin.show();"
                        />

                </h:panelGrid>
            </p:dialog>
        </f:view>
    </h:form>

    <h:form id="frmRegisterDetail">
        <f:view>
            <p:dialog id="dlgRegisterDetail"
                      widgetVar="wgRegisterDetail"
                      header="Register"
                      draggable="true"
                      showEffect="fade"
                      hideEffect="fade"
                      modal="true"
                      closable="false">
                <h:panelGrid id="pnRegisterDetail" columns="2" cellspacing="5" >

                    <h:outputLabel value="UserName:" for="userName" />
                    <h:inputText id="userName" value="#{userBean.userTemp.userName}" required="true" maxlength="30" title="UserName" />
                    <h:outputLabel value="Password:" for="password" />
                    <p:password match="repassword" id="password" value="#{userBean.userTemp.password}" required="true" maxlength="30" />
                    <h:outputLabel value="Re-Password:" for="repassword" />
                    <p:password id="repassword" value="#{userBean.userTemp.password}" required="true" maxlength="30" />
                    <h:outputLabel value="Titles" for="stTitles" />
                    <h:selectOneMenu  id="stTitles" value="#{userBean.userTemp.titleOfCourtesy}" title="TitleOfCourtesy" >
                        <f:selectItem itemLabel="Mr" itemValue="Mr"  />
                        <f:selectItem  itemLabel="Mrs" itemValue="Mrs" />
                        <f:selectItem  itemLabel="Ms" itemValue="Ms" />
                        <f:selectItem  itemLabel="Miss" itemValue="Miss" />
                    </h:selectOneMenu>

                    <h:outputLabel value="LastName:" for="lastName" />
                    <h:inputText id="lastName" value="#{userBean.userTemp.lastName}" title="LastName"  required="true" maxlength="16"  />
                    <h:outputLabel value="FristName:" for="fristName" />
                    <h:inputText id="fristName" value="#{userBean.userTemp.fristName}" title="FristName"   required="true" maxlength="16" />
                    <h:outputLabel value="Address:" for="address" />
                    <h:inputText id="address" value="#{userBean.userTemp.address}" title="Address" maxlength="300" />
                    <h:outputLabel value="City:" for="city" />
                    <h:inputText id="city" value="#{userBean.userTemp.city}" title="City" maxlength="30" />
                    <h:outputLabel value="Region:" for="region" />
                    <h:inputText id="region" value="#{userBean.userTemp.region}" title="Region" maxlength="30" />
                    <h:outputLabel value="PostalCode:" for="postalCode" />
                    <h:inputText id="postalCode" value="#{userBean.userTemp.postalCode}" title="PostalCode" />
                    <h:outputLabel value="MobilePhone:" for="mobilePhone" />
                    <h:inputText id="mobilePhone" value="#{userBean.userTemp.mobilePhone}" title="MobilePhone" />
                    <h:outputLabel value="Email:" for="email" />
                    <h:inputText id="email" value="#{userBean.userTemp.email}" title="Email"  required="true" maxlength="30"  />
                    <h:outputLabel value="Answer:" for="answer" />
                    <h:inputText id="answer" value="#{userBean.userTemp.answer}" title="Answer"  required="true" maxlength="30"  />

                    <p:commandButton
                        value="Submit"
                        actionListener="#{userBean.RegisterEmployee}"
                        update=":growl"
                        oncomplete="LoginRequest(xhr, status, args)"
                        />
                    <p:commandButton
                        value="Cancel"
                        onclick="wgRegisterDetail.hide();wgLogin.show();"
                        />
                </h:panelGrid>
            </p:dialog>
        </f:view>
    </h:form>
</html>
